package com.chenjun.core.vo.sys;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

import org.springframework.beans.BeanUtils;

import com.chenjun.core.dao.generator.entity.SysResource;
/**
 * 
 * @ClassName: ResourceDto
 * @author Sean Cui
 * @date 2016-06-14 下午17:50:00 
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @version V1.0.0.0
 * @comment 该文件通过代码生成器生成，如果修改次文件后，重新生成时将覆盖修改内容，请修改生成模板或做好备份
 */

@SuppressWarnings("serial")
public class ResourceDto implements Serializable{
	
    /**
     * id  
     * db_column: id 
     */	
	private String id;
    /**
     * 菜单名  
     * db_column: name 
     */	
	private String name;
    /**
     * 国际化资源文件key  
     * db_column: i18n_key 
     */	
	private String i18nKey;
    /**
     * 链接地址  
     * db_column: url 
     */	
	private String url;
    /**
     * 父ID  
     * db_column: parent_id 
     */	
	private String parentId;
    /**
     * 0:菜单资源，1:权限资源  
     * db_column: type 
     */	
	private String type;
    /**
     * 权限  
     * db_column: permissions 
     */	
	private String permissions;
    /**
     * 顺序号  
     * db_column: sort_num 
     */	
	private int sortNum;
    /**
     * 创建时间  
     * db_column: created_time 
     */	
	private Date createdTime;
	
	public void setId(String id) {
		this.id = id == null ? null : id.trim();
	}
	
	public String getId() {
		return this.id;
	}
	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}
	
	public String getName() {
		return this.name;
	}
	public void setI18nKey(String i18nKey) {
		this.i18nKey = i18nKey == null ? null : i18nKey.trim();
	}
	
	public String getI18nKey() {
		return this.i18nKey;
	}
	public void setUrl(String url) {
		this.url = url == null ? null : url.trim();
	}
	
	public String getUrl() {
		return this.url;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId == null ? null : parentId.trim();
	}
	
	public String getParentId() {
		return this.parentId;
	}
	public void setType(String type) {
		this.type = type == null ? null : type.trim();
	}
	
	public String getType() {
		return this.type;
	}
	public void setPermissions(String permissions) {
		this.permissions = permissions == null ? null : permissions.trim();
	}
	
	public String getPermissions() {
		return this.permissions;
	}
	public void setSortNum(int sortNum) {
		this.sortNum = sortNum;
	}
	
	public int getSortNum() {
		return this.sortNum;
	}
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	
	public Date getCreatedTime() {
		return this.createdTime;
	}
	
	/**
	 * 根据Bean获取Model模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static ResourceDto getDtoByModel(SysResource source) throws IllegalAccessException, InvocationTargetException{
		ResourceDto target = new ResourceDto();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static SysResource getModelByDto(ResourceDto source) throws IllegalAccessException, InvocationTargetException{
		SysResource target = new SysResource();
		BeanUtils.copyProperties(source, target);
		return target;
	}

}
